<template>
  <div id="app">
    <Header />
    <router-view></router-view>
    <!-- 
      场景:点击home和search路由时,显示footer,点击登录和注册路由时,不显示footer
    解决:(错误写法)通过meta传参,在login和register路由表中书写meta:{footerIsShow:false} 在Footer组件上书写v-show="footerIsShow",这种写法中home和search中没有这个值,就是undefined,在布尔值转换的时候是false,所以Footer也是不显示的
    (正确写法)所以在login和register路由表中书写meta:{footerIsShow:true},在在Footer组件上书写v-show="!footerIsShow"
     -->
    <Footer v-show="!$route.meta.footerIsShow" />
  </div>
</template>

<script>
import { mapActions} from "vuex";

import Header from "./components/Header";
import Footer from "./components/Footer";

export default {
  name: "App",
  components: {
    Header,
    Footer,
  },
    mounted() {
    this.getCategoryList();
  },
  methods:{
        ...mapActions("home", ["getCategoryList"]),
  }
};
</script>

<style>
</style>
